﻿<UserControl x:Class="Mengsk.ProxyDelivery.App.UI.Delivery.ReturnUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="800"  Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="物流公司:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Name="cbbDeliveryCompanies" VerticalAlignment="Center" Width="120"/>
            <TextBlock Text="物流单号:" Margin="3" VerticalAlignment="Center" />
            <TextBox Name="tbDeliveryNumber" Margin="3" VerticalAlignment="Center" PreviewKeyDown="tbDeliveryNumber_PreviewKeyDown" Width="120"/>
            <Button Name="btnUpload" Margin="3" VerticalAlignment="Center" Click="btnUpload_Click" Content="上传" Width="80"/>
            <Button Name="btnClear" Content="清空" Margin="3" VerticalAlignment="Center" Width="80" Click="btnClear_Click"/>
            <TextBlock Name="tbTotalInfo" Margin="3" VerticalAlignment="Center" FontSize="16"/>
        </StackPanel>

        <DataGrid Grid.Row="1" Name="dgvOrderChanges"  AutoGenerateColumns="False" GridLinesVisibility="All"  CanUserAddRows="False" CanUserDeleteRows="False"  CanUserReorderColumns="False">
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="图片" Width="Auto">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <Image Width="60" Height="60" Source="{Binding Image,Converter={StaticResource webUrlImageConverter}}"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Header="退换编号" Binding="{Binding Source.Id}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="卖家编号" Binding="{Binding Source.SellerId}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="订单编号" Binding="{Binding Source.OrderId}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="子订单编号" Binding="{Binding Source.OrderGoodsId}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="物流公司" Binding="{Binding DeliveryCompany}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="物流单号" Binding="{Binding DeliveryNumber}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="创建时间" Binding="{Binding Source.CreateTime,Converter={StaticResource datetimeConverter}}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="当前状态" Binding="{Binding Source.State,Converter={StaticResource descriptionConverter}}" Width="Auto" IsReadOnly="True"/>
                <DataGridTextColumn Header="上传状态" Binding="{Binding State}"/>
                <DataGridHyperlinkColumn Header="删除" Width="Auto" Binding="{Binding Path=Action}" IsReadOnly="True">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="Delete_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
                <DataGridTextColumn Header="商品信息" Binding="{Binding OrderGoodsInfo}" Width="*"/>
                <DataGridTextColumn Header="描述信息" Binding="{Binding Comment}" Width="*"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
